import { createStore, Store, useStore as useVuexStore } from 'vuex'
import { IStoreType, IRootState } from './types'

import login from './login/login'
import user from './user/user'

const store = createStore<IRootState>({
  state() {
    return {
      test: '',
    }
  },
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    login,
    user,
  },
})

// 解决 vuex 没有提示
export function useStore(): Store<IStoreType> {
  return useVuexStore()
}

export default store
